package cl.blueprintsit.filmdisk.model;

/**
 */
public class Actor implements Comparable<Actor>{
    private final String name;

    public Actor(String actorName) {
        this.name = actorName.trim();
    }

    @Override
    public String toString() {
        return this.name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Actor actor = (Actor) o;

        if (name != null ? !name.equalsIgnoreCase(actor.name) : actor.name != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return name != null ? name.hashCode() : 0;
    }

    @Override
    public int compareTo(Actor actor) {
        return name.compareTo(actor.name);
    }
}
